import { IPSWFLinkCond } from './ipswflink-cond';
import { IPSWFLinkGroupCond } from './ipswflink-group-cond';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSWFLinkGroupCondImpl extends PSModelObjectImpl implements IPSWFLinkGroupCond {
  get codeName(): string {
    return this.M.codeName;
  }

  get condType(): 'GROUP' | 'SINGLE' | 'CUSTOM' {
    return this.M.condType;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get groupOP(): 'AND' | 'OR' {
    return this.M.groupOP;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  protected pswflinkconds: IPSWFLinkCond[] | null = null;

  getPSWFLinkConds(): IPSWFLinkCond[] | null {
    if (this.pswflinkconds == null) {
      this.pswflinkconds = this.fillChildListModel(this.M.getPSWFLinkConds, 'wf.IPSWFLinkCond') as IPSWFLinkCond[];
    }
    return this.pswflinkconds;
  }

  get psWFLinkConds(): IPSWFLinkCond[] | null {
    return this.getPSWFLinkConds();
  }

  findPSWFLinkCond(objKey: any): IPSWFLinkCond | null {
    return this.getPSModel5('wf.IPSWFLinkCond', this.getPSWFLinkConds(), objKey) as IPSWFLinkCond;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get notMode(): boolean {
    return this.M.notMode;
  }

  get cls(): string {
    return 'PSWFLinkGroupCondImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'wf.IPSWFLinkGroupCond') return true;
    return super.instanceof(cls);
  }
}
